﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SmartWMS.Common.ResponseOutput;
using SmartWMS.Domain.BasicsDatum;
using SmartWMS.Domain.WarehouseManage;
using SmartWMS.Server.StatementServer.InventoryServices;
using SmartWMS.Server.StatementServer.InventoryServices.Dto;

namespace SmartWMS.API.Controllers.StatementMange
{
    /// <summary>
    /// 库存清单
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    [ApiExplorerSettings(GroupName = "Statement")]

    public class InventoryController : ControllerBase
    {
        private readonly IInventoryService _inventoryService;

        public InventoryController(IInventoryService inventoryService)
        {
            _inventoryService = inventoryService;
        }

        /// <summary>
        /// 库存清单列表
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        [HttpPost]
        public Task<Response<List<InventoryDto>>> GetInventoryDtoPes(InventorySelect dto)
        {
            var list = _inventoryService.GetInventoryDtoPes(dto);
            return list;
        }

        /// <summary>
        /// 仓库列表(下拉框)
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public Task<Response<List<Warehouse>>> GetWarehouseList()
        {
            var result = _inventoryService.GetWarehouseList();
            return result;
        }

        /// <summary>
        /// 批次下拉框
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public Task<Response<List<InWarehouseDetail>>> GetBatchList()
        {
            var result= _inventoryService.GetBatchList();
            return result;
        }

    }
}
